import { Injectable } from '@angular/core';

import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';

import { CustomConfigFormComponent } from './custom-config-form.component';

@Injectable()
export class CustomConfigFormService {
  constructor(private modalSrc: NzModalService) {}

  public open(title: string, params?: any): NzModalRef {
    const options = {
      nzTitle: title,
      nzClosable: true,
      nzMaskClosable: false,
      nzContent: CustomConfigFormComponent,
      nzComponentParams: params,
      nzFooter: null
    };

    return this.modalSrc.create(options);
  }
}
